package cn.javass.dp.chianofresponsibility.example4;

public class GeneralManager extends Handle {
    @Override
    public String handleFeeRequest(String user, double fee) {

        String str = "";
        if (fee >= 1000) {
            if ("小李".equals(user)) {
                str = "总经理同意" + user + "聚餐费用" + fee + "请求";
            } else {
                str = "总经理不！！！同意" + user + "聚餐费用" + fee + "请求";

            }
        } else {
            if (this.successor != null) {
                return successor.handleFeeRequest(user, fee);
            }
        }
        return str;
    }

    @Override
    public boolean handlePreFeeRequest(String user, double requestNum) {
        if (requestNum >= 5000) {
            System.out.println("总经理同意"+user+"预支差旅费"+requestNum+"元");
            return true;
        } else {
            if (successor != null) {
                return this.successor.handlePreFeeRequest(user, requestNum);
            }
        }
        return false;
    }
}
